﻿Imports System.Data.OleDb
Imports DTO
Public Class MonHocDao
    Public Function LayDSMonHoc() As List(Of MonHocDto)
        Dim ds As New List(Of MonHocDto)
        Dim cn As OleDbConnection = DataProvider.ConnectDB()
        Dim strSQL As String = "Select *from MONHOC"
        Dim cmd As New OleDbCommand(strSQL, cn)
        Dim dr As OleDbDataReader
        dr = cmd.ExecuteReader()
        Dim mh As New MonHocDto()
        While (dr.Read())
            mh = New MonHocDto()
            mh.MaMon = dr("MaMH")
            mh.TenMon = dr("TenMH")
            ds.Add(mh)
        End While
        cn.Close()
        Return ds
    End Function
End Class
